-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java: FT.EXPLAIN and FT.EXPLAINCLI #2515
base: release-1.2
Are you sure you want to change the base?
Conversation
Signed-off-by: Chloe <chloe.yip@improving.com>
Signed-off-by: Chloe Yip <chloe.yip@improving.com>
Signed-off-by: Chloe <chloe.yip@improving.com>
Signed-off-by: Chloe <chloe.yip@improving.com>
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Chloe <chloe.yip@improving.com>
Signed-off-by: Chloe <chloe.yip@improving.com>
Signed-off-by: Chloe <chloe.yip@improving.com>
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
java/client/src/main/java/glide/api/commands/servermodules/FT.java
Outdated
Show resolved
Hide resolved
assertTrue(exception.getMessage().contains("Index not found")); | ||
} | ||
|
||
@SneakyThrows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: instead, you can throw on the method signature
java/integTest/src/test/java/glide/modules/VectorSearchTests.java
Outdated
Show resolved
Hide resolved
java/integTest/src/test/java/glide/modules/VectorSearchTests.java
Outdated
Show resolved
Hide resolved
// search query containing numeric field. | ||
String query = "@price:[0 10]"; | ||
String result[] = FT.explaincli(client, indexName, query).get(); | ||
List<String> resultList = new ArrayList<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an interesting exercise, you can use Stream() to map result to a result list. Something like:
List<String> trimmedResult = result.stream().map(::trim).collect(Collection.toList());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately streams only work on lists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arrays.stream() works on arrays. I'll point you to an example, and IntelliJ has a lot of hints to help create streams.
assertTrue((resultListGS).contains("0")); | ||
assertTrue((resultListGS).contains("10")); | ||
|
||
resultListGS.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just use a new variable. memory is cheap
Signed-off-by: Chloe <chloe.yip@improving.com>
Issue link
This Pull Request is linked to issue (URL): #2428
Checklist
Before submitting the PR make sure the following are checked: